package com.mpastruct.test;

import com.mpastruct.test.convertor.PersonConverter;
import com.mpastruct.test.dto.PersonDTO;
import com.mpastruct.test.entities.PersonDO;
import com.mpastruct.test.enums.Gender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

public class App {
    private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) throws InterruptedException {
        PersonDO personDO = new PersonDO();
        personDO.setName("Hollis");
        personDO.setAge(26);
        personDO.setBirthday(new Date());
        personDO.setId(1);
        personDO.setGender(Gender.male.name());
        PersonDTO personDTO = PersonConverter.INSTANCE.do2dto(personDO);
        LOGGER.info(personDTO.toString());

        Thread.currentThread().join();
    }
}
